﻿using System;
using FridgeCase;

namespace FridgeCaseSample
{
    class Program
    {
        static void Main()
        {
            /*var fridge = new Fridge();
            fridge.ReverseLine(3, 2);
            fridge.ReverseLine(2, 2);
            fridge.ReverseLine(2, 1);
            fridge.ReverseLine(0, 0);
            ShowFridge4X4(fridge.Refrigerator);
            Console.WriteLine("\n\nFinding the solution: {0}.\n", fridge.FindSolution());
            ShowFridge4X4(fridge.Refrigerator);
            Console.WriteLine("\n\nEnter...");
            Console.ReadLine();*/
            var fridger = new Fridger
                {
                    FridgeField = new[,]
                        {
                            {false, false, true, false},
                            {false, true, false, true},
                            {true, false, false, false},
                            {false, true, false, true}
                        }
                };
            ShowFridger(fridger.FridgeField);
            Console.WriteLine("\n{0}\n", fridger.Help());
            ShowFridger(fridger.FridgeField);
            Console.ReadLine();
        }

        private static void ShowFridge4X4(char[,] showFridge)
        {
            for (var i = 0; i < 4; i++)
            {
                for (var j = 0; j < 4; j++)
                    Console.Write("\t{0}", showFridge[i, j]);
                Console.WriteLine();
            }
        }

        private static void ShowFridger(bool[,] showFridge)
        {
            for (var i = 0; i < 4; i++)
            {
                for (var j = 0; j < 4; j++)
                    Console.Write("\t{0}", showFridge[i, j]);
                Console.WriteLine();
            }
        }
    }
}
